﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<TITLE>客户列表</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="${pageContext.request.contextPath }/css/Style.css"
	type=text/css rel=stylesheet>
<LINK href="${pageContext.request.contextPath }/css/Manage.css"
	type=text/css rel=stylesheet>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.4.4.min.js"></script>
<SCRIPT language=javascript>
	/* function to_page(page){
		if(page){
			$("#page").val(page);
		}
		document.customerForm.submit();	
	} */

	function delOne(custId) {

		var sure = window.confirm("确定删除吗?");
		if (sure) {
			/* alert(custId); */
			window.location.href = "${pageContext.request.contextPath }/customer/removeCustomer?custId="
					+ custId;
		}
	}
</SCRIPT>
<META content="MSHTML 6.00.2900.3492" name=GENERATOR>
</HEAD>
<BODY>
	<s:debug></s:debug>
	<s:form namespace="/customer" action="listCustomer">
		<%-- <FORM id="customerForm" name="customerForm" action="${pageContext.request.contextPath }/customer/listCustomer.action" method=post>	 --%>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15><IMG
						src="${pageContext.request.contextPath }/images/new_019.jpg"
						border=0></TD>
					<TD width="100%"
						background="${pageContext.request.contextPath }/images/new_020.jpg"
						height=20></TD>
					<TD width=15><IMG
						src="${pageContext.request.contextPath }/images/new_021.jpg"
						border=0></TD>
				</TR>
			</TBODY>
		</TABLE>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15
						background="${pageContext.request.contextPath }/images/new_022.jpg">
						<IMG src="${pageContext.request.contextPath }/images/new_022.jpg"
						border=0>
					</TD>
					<TD vAlign=top width="100%" bgColor=#ffffff>
						<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
							<TR>
								<TD class=manageHead>当前位置：客户管理 &gt; 客户列表</TD>
							</TR>
							<TR>
								<TD height=2></TD>
							</TR>
						</TABLE>
						<TABLE borderColor=#cccccc cellSpacing=0 cellPadding=0
							width="100%" align=center border=0>
							<TBODY>
								<TR>
									<TD height=25>
										<TABLE cellSpacing=0 cellPadding=2 border=0>
											<TBODY>
												<TR>
													<TD>客户名称：</TD>
													<td>
														<!-- 使用struts便签,值必须加上引号   在最新版本的struts可以只在第一个值加上引号 -->
														 <s:textfield	class="textbox" id="sChannel2" style="WIDTH: 100px"
															maxLength="50" name="custName" />
													</td>
													<td>所属行业 ：</td>
													<td><s:textfield class="textbox" id="sChannel2"
															style="WIDTH: 100px" maxLength="50" name="custIndustry" />
													</td>

													<td>信息来源 ：</td>
													<td><s:select name="custSourceId" list="custSources"
															listKey="dictId" listValue="dictItemName" headerKey=""
															headerValue="---请选择---" class="textbox" id="sChannel2"
															style="WIDTH: 100px" /></td>
													<td>客户级别：</td>
													<td><s:select name="custLevelId" list="custLevels"
															listKey="dictId" listValue="dictItemName" headerKey=""
															headerValue="---请选择---" class="textbox" id="sChannel2"
															style="WIDTH: 100px" /></td>
													<TD>
													<s:submit value="筛选"></s:submit>
													</TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
								<TR>
									<TD>
										<TABLE id=grid
											style="BORDER-TOP-WIDTH: 0px; FONT-WEIGHT: normal; BORDER-LEFT-WIDTH: 0px; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 0px; BORDER-BOTTOM-COLOR: #cccccc; WIDTH: 100%; BORDER-TOP-COLOR: #cccccc; FONT-STYLE: normal; BACKGROUND-COLOR: #cccccc; BORDER-RIGHT-WIDTH: 0px; TEXT-DECORATION: none; BORDER-RIGHT-COLOR: #cccccc"
											cellSpacing=1 cellPadding=2 rules=all border=0>
											<TBODY>
												<TR
													style="FONT-WEIGHT: bold; FONT-STYLE: normal; BACKGROUND-COLOR: #eeeeee; TEXT-DECORATION: none">
													<TD>客户名称</TD>
													<TD>客户级别</TD>
													<TD>客户来源</TD>
													<TD>所属行业</TD>
													<TD>联系地址</TD>
													<TD>联系电话</TD>
													<TD>操作</TD>
												</TR>
												<s:iterator value="customers">
													<TR
														style="FONT-WEIGHT: normal; FONT-STYLE: normal; BACKGROUND-COLOR: white; TEXT-DECORATION: none">
														<TD>${custName}</TD>
														<TD>${custLevelBaseDict.dictItemName}</TD>
														<TD>${custSourceBaseDict.dictItemName}</TD>
														<TD>${custIndustry}</TD>
														<TD>${custAddress}</TD>
														<TD>${custPhone}</TD>
														<TD>
														<a href="${pageContext.request.contextPath }/customer/editCustomerUI?custId=${custId}">修改</a>
															&nbsp;&nbsp; 
													<%-- <a href="${pageContext.request.contextPath }/customer/removeCustomer?custId=${custId}">删除1</a> 
													<a href="#" onclick="delOne(${custId})">删除2</a>
													<a href="javascript:delOne(${custId})">删除3</a>--%> <!-- 使用struts框架便签传参需要使用OGNL表达式 -->
															<s:a href="javascript:delOne('%{custId}')">删除</s:a></TD>
													</TR>
												</s:iterator>
											</TBODY>
										</TABLE>
									</TD>
								</TR>




								<!-- 分页查询开始 -->
								<%--  <TR>
									<TD>
										<SPAN id=pagelink>
											<DIV style="LINE-HEIGHT: 20px; HEIGHT: 20px; TEXT-ALIGN: right">
												共[<B>${total}</B>]条记录,[<B>${totalPage}</B>]页
												,每页显示
												<select name="pageSize">
												
												<option value="15" <c:if test="${pageSize==15 }">selected</c:if>>15</option>
												<option value="30" <c:if test="${pageSize==30 }">selected</c:if>>30</option>
												</select>
												条
												[<A href="javascript:to_page(${page-1})">前一页</A>]
												<B>${page}</B>
												[<A href="javascript:to_page(${page+1})">后一页</A>] 
												到
												<input type="text" size="3" id="page" name="page" />
												页
												
												<input type="button" value="Go" onclick="to_page()"/>
											</DIV>
										</SPAN>
									</TD>
								</TR> 
								 --%>

								<!-- 分页查询结束  -->

							</TBODY>
						</TABLE>
					</TD>
					<TD width=15
						background="${pageContext.request.contextPath }/images/new_023.jpg">
						<IMG src="${pageContext.request.contextPath }/images/new_023.jpg"
						border=0>
					</TD>
				</TR>
			</TBODY>
		</TABLE>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15><IMG
						src="${pageContext.request.contextPath }/images/new_024.jpg"
						border=0></TD>
					<TD align=middle width="100%"
						background="${pageContext.request.contextPath }/images/new_025.jpg"
						height=15></TD>
					<TD width=15><IMG
						src="${pageContext.request.contextPath }/images/new_026.jpg"
						border=0></TD>
				</TR>
			</TBODY>
		</TABLE>
		<!-- </FORM> -->
	</s:form>
</BODY>
</HTML>
